package com.jjb.www.ui.adapter;

import android.content.Context;
import android.os.Build;
import android.text.Html;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;

import com.hjq.shape.view.ShapeTextView;
import com.jjb.www.R;
import com.jjb.www.app.AppAdapter;

/**
 * @author CRG
 * @date :2023/12/25 15:30
 * @description:
 */
public class MsgAdapter  extends AppAdapter<String> {

    public MsgAdapter(Context context) {
        super(context);
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder();
    }

    private final class ViewHolder extends AppAdapter<?>.ViewHolder {
        private ShapeTextView mTvTitle;



        private ViewHolder() {
            super(R.layout.item_msg);
            mTvTitle = findViewById(R.id.tv_title);
        }

        @Override
        public void onBindView(int position) {
            mTvTitle.setText(Html.fromHtml(getItem(position),Html.FROM_HTML_MODE_LEGACY));
        }
    }
}